home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-SIG: World of Education
/
PC-SiG's World of Education.iso
/
run
/
2602
/
pg&e.alg
< prev
next >
Wrap
Text File
|
1990-05-09
|
2KB
|
74 lines
{ PG&E.ALG - Process Pacific Gas & Electric bill data }
interp = off;
step = 1;
file = "pg&e.dat";
Total = read & { total bill dollars }
Tax = read & { tax amount }
Therms = read & { gas therms for billing period }
ThermsCost = read & { amount charged for gas therms }
KwHrs = read & { Kilowatt hours for billing period }
KwHrsCost = read; { amount charged for electricity }
label="Gas and Electric Charges for Each Month";
Ylabel = "Dollars"; Xlabel = "Date";
xformat=dates;
ymin = 0; ymax = 150;
trace=vline & plot(Total) &
trace=line & plot(ThermsCost) &
plot({ThermsCost + }KwHrsCost);
color=1; text="1 Total Bill (incl taxes)"; note(xposn(.02),yposn(.95));
color=2; text="2 Gas"; note(xposn(.02),yposn(.90));
color=3; text="3 Electricity"; note(xposn(.02),yposn(.85));
pause;
label="Gas and Electric Usage";
ylabel="Therms and KwHrs";
ymin = 0; ymax=400;
erase;
tracenum=on;
color=2 & plot(Therms) & plot(avg(Therms)) &
color=3 & plot(KwHrs) & plot(avg(KwHrs));
color=2; text="1 Gas Therms"; note(xposn(.02),yposn(.90));
color=3; text="2 Electricity KwHrs"; note(xposn(.02),yposn(.85));
pause;
label="Ratio of Gas and Electric Charges To Usage for Each Month";
Ylabel = "Ratio : Dollars / Usage"; Xlabel = "Date";
xformat=dates;
ymin = 0; ymax = 1;
erase;
color = 1 & plot(avg(ThermsCost/Therms)) &
color = 2 & plot(ThermsCost / Therms) &
color = 3 & plot(KwHrsCost / KwHrs);
color=1; text="1 Avg. (Gas Cost / Therms Used)"; note(xposn(.02),yposn(.95));
color=2; text="2 Gas Cost / Therms Used"; note(xposn(.02),yposn(.90));
color=3; text="3 Electricity Cost / KwHrs Used"; note(xposn(.02),yposn(.85));
pause;
label="Gas and Electric Charges As A Percentage of Total PG&E Bill";
ylabel="Percentage";
ymin = 0; ymax=100;
erase;
tracenum=on;
plot(100 * Tax/Total) &
plot(100 * ThermsCost/Total) &
plot(100 * KwHrsCost/Total);
color=1; text="1 Taxes"; note(xposn(.02),yposn(.95));
color=2; text="2 Gas"; note(xposn(.02),yposn(.90));
color=3; text="3 Electricity"; note(xposn(.02),yposn(.85));
pause;
scaley(sum(Total));
erase;
label="Cummulative PG&E Charges";
ylabel = "Dollars";
total_charges = sum(Total) &
nbr_bills = count(total_charges) &
plot(total_charges);
constant(total_charges); constant(nbr_bills);
text = "Total PG&E bill: $"; note(total_charges,xposn(.1),yposn(.9));
text = " Avg. PG&E bill: $";
note(total_charges/nbr_bills,xposn(.1),yposn(.85));